package com.ruoyi.train.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.train.mapper.ETrainMapper;
import com.ruoyi.common.core.domain.e_train.ETrain;
import com.ruoyi.train.service.IETrainService;

/**
 * 培训Service业务层处理
 * 
 * @author JYW
 * @date 2024-01-30
 */
@Service
public class ETrainServiceImpl implements IETrainService 
{
    @Autowired
    private ETrainMapper eTrainMapper;

    /**
     * 查询培训
     * 
     * @param id 培训主键
     * @return 培训
     */
    @Override
    public ETrain selectETrainById(Long id)
    {
        return eTrainMapper.selectETrainById(id);
    }

    /**
     * 查询培训列表
     * 
     * @param eTrain 培训
     * @return 培训
     */
    @Override
    public List<ETrain> selectETrainList(ETrain eTrain)
    {
        return eTrainMapper.selectETrainList(eTrain);
    }

    /**
     * 新增培训
     * 
     * @param eTrain 培训
     * @return 结果
     */
    @Override
    public int insertETrain(ETrain eTrain)
    {
        eTrain.setCreateTime(DateUtils.getNowDate());
        return eTrainMapper.insertETrain(eTrain);
    }

    /**
     * 修改培训
     * 
     * @param eTrain 培训
     * @return 结果
     */
    @Override
    public int updateETrain(ETrain eTrain)
    {
        eTrain.setUpdateTime(DateUtils.getNowDate());
        return eTrainMapper.updateETrain(eTrain);
    }

    /**
     * 批量删除培训
     * 
     * @param ids 需要删除的培训主键
     * @return 结果
     */
    @Override
    public int deleteETrainByIds(Long[] ids)
    {
        return eTrainMapper.deleteETrainByIds(ids);
    }

    /**
     * 删除培训信息
     * 
     * @param id 培训主键
     * @return 结果
     */
    @Override
    public int deleteETrainById(Long id)
    {
        return eTrainMapper.deleteETrainById(id);
    }
}
